@import '../../style/themes/index';
@import './token.less';
@input-prefix-cls: ~'@{kd-prefix}-input';

// 输入框默认样式Mixins
.input(@prefix) {
  @disabled-prefix-cls: ~'@{prefix}-disabled';
  @error-prefix-cls: ~'@{input-prefix-cls}-error';
  width: 100%;
  min-width: 0;
  border: @input-border-width-inner solid @input-border-color-disabled-inner;
  border-radius: @input-border-radius-inner;
  color: @input-font-color-inner;
  box-sizing: border-box;
  background-color: @input-background-color-inner;
  display: inline-block;
  font-variant: tabular-nums;
  list-style: none;
  background-image: none;
  font-feature-settings: "tnum";

  &::-webkit-input-placeholder {
    color: @input-placeholder-color-inner !important;
  }
  &::-moz-input-placeholder {
    color: @input-placeholder-color-inner !important;
  }
  &::-ms-input-placeholder {
    color: @input-placeholder-color-inner !important;
  }
  &:focus {
    box-shadow: none;
    outline: none;
  }
  &:not(.@{disabled-prefix-cls}):not(.@{error-prefix-cls}):hover {
    border-color: @input-border-color-focused;
  }
  &:not(.@{disabled-prefix-cls}):not(.@{error-prefix-cls}):focus {
    color: @input-focus-color;
    border-color: @input-border-color-focused;
  }
}

.input-size(@height, @fonSize, @padding-vertical, @padding-horizontal) {
  height: @height;
  line-height: calc(@height - (@padding-vertical * 2) - (@input-border-width * 2));
  font-size: @fonSize;
  padding: @padding-vertical @padding-horizontal;

  .@{input-prefix-cls}-suffix {
    margin-left: calc(@padding-vertical * 2);
  }

  .@{input-prefix-cls}-prefix {
    margin-right: calc(@padding-vertical * 2);
  }

  &.@{input-prefix-cls}-underline {
    padding-right: 0;
    padding-left: 0;
  }

  &.@{input-prefix-cls}-wrapper-underline {
    padding-right: 0;
    padding-left: 0;
  }
}

.input-clear-icon() {
  cursor: pointer;
  color: @input-clear-color;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  &:hover {
    color: @input-clear-color-hover;
  }

  i {
    vertical-align: middle;
    font-size: 16px;
  }
}


.border-less() {
  border: none !important;
}

.underline() {
  border: none;
  border-bottom: 1px solid @input-color-border;
  border-radius: 0 !important;
  padding-left: 0;
}
